import { Column, Entity, ManyToOne } from 'typeorm';
import { CommonEntity } from '../../../../util/entity/common.entity';
import { Dict } from '../../dict/entities/dict.entity';

@Entity('sys_dict_son')
export class DictSon extends CommonEntity {
  @Column({ comment: '名称', length: 30 })
  name: string;

  @Column({ comment: '编号' })
  code: number;

  @Column({ default: 1, comment: '排序' })
  sort?: number;

  @ManyToOne(() => Dict, (dict) => dict.dictSons)
  dict: Dict;
}
